import Ajax from "../../utils/ajax"
Page({
 
  data: {
    property:{

    },
    fileList1:[{ url:'https://img.yzcdn.cn/vant/tree.jpg'},
    { url:'https://img.yzcdn.cn/vant/leaf.jpg'},
    { url:'https://img.yzcdn.cn/vant/leaf.jpg'},
    { url:'https://img.yzcdn.cn/vant/leaf.jpg'},{ url:'https://img.yzcdn.cn/vant/leaf.jpg'},],
    fileList2:[{ url:'https://img.yzcdn.cn/vant/leaf.jpg'},{ url:'https://img.yzcdn.cn/vant/leaf.jpg'},{ url:'https://img.yzcdn.cn/vant/leaf.jpg'},],
  },
 
  onLoad: function (options) {
   var th = this; 
    console.log(options);
    Ajax.get('/property/' + options.id,{}).then((res)=>{
      console.log("查询成功",res);
      th.setData({property: res.data,propertyId:options.id}) 
    }); 
  },
  
  onReady: function () {

  }, 
  onShow: function () {

  },    
  swap1(){ 
    var tmp = this.data.fileList1
    var f1 = tmp.shift()
    console.log(f1);
    tmp.push(f1)
    console.log(tmp);
    this.setData({ fileList1:tmp })
  },
  swap2(){ 
    var tmp = this.data.fileList2
    var f1 = tmp.shift()
    console.log(f1);
    tmp.push(f1)
    console.log(tmp);
    this.setData({ fileList2:tmp })
  },
  join(){

    Ajax.get('/property/join/' + this.data.propertyId,{}).then((res)=>{
      console.log("查询成功",res); 
    }); 
  }
})